package com.ruoyi.system.service.impl;

import com.ruoyi.common.core.text.Convert;
import com.ruoyi.system.domain.YtCustomerInvoice;
import com.ruoyi.system.mapper.YtCustomerInvoiceMapper;
import com.ruoyi.system.service.IYtCustomerInvoiceService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 客户发票Service业务层处理
 * 
 * @author magichaohao
 * @date 2021-05-13
 */
@Service
public class YtCustomerInvoiceServiceImpl implements IYtCustomerInvoiceService 
{
    @Autowired
    private YtCustomerInvoiceMapper ytCustomerInvoiceMapper;

    /**
     * 查询客户发票
     * 
     * @param clientInvoiceId 客户发票ID
     * @return 客户发票
     */
    @Override
    public YtCustomerInvoice selectYtCustomerInvoiceById(Long clientInvoiceId)
    {
        return ytCustomerInvoiceMapper.selectYtCustomerInvoiceById(clientInvoiceId);
    }

    @Override
    public List<YtCustomerInvoice> selectYtCustomerMsgById(Long customerId) {
        return ytCustomerInvoiceMapper.selectYtCustomerMsgById(customerId);
    }


    /**
     * 查询客户发票列表
     * 
     * @param ytCustomerInvoice 客户发票
     * @return 客户发票
     */
    @Override
    public List<YtCustomerInvoice> selectYtCustomerInvoiceList(YtCustomerInvoice ytCustomerInvoice)
    {
        return ytCustomerInvoiceMapper.selectYtCustomerInvoiceList(ytCustomerInvoice);
    }

    /**
     * 新增客户发票
     * 
     * @param ytCustomerInvoice 客户发票
     * @return 结果
     */
    @Override
    public int insertYtCustomerInvoice(YtCustomerInvoice ytCustomerInvoice)
    {
        return ytCustomerInvoiceMapper.insertYtCustomerInvoice(ytCustomerInvoice);
    }

    /**
     * 修改客户发票
     * 
     * @param ytCustomerInvoice 客户发票
     * @return 结果
     */
    @Override
    public int updateYtCustomerInvoice(YtCustomerInvoice ytCustomerInvoice)
    {
        return ytCustomerInvoiceMapper.updateYtCustomerInvoice(ytCustomerInvoice);
    }

    /**
     * 删除客户发票对象
     * 
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteYtCustomerInvoiceByIds(String ids)
    {
        return ytCustomerInvoiceMapper.deleteYtCustomerInvoiceByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除客户发票信息
     * 
     * @param clientInvoiceId 客户发票ID
     * @return 结果
     */
    @Override
    public int deleteYtCustomerInvoiceById(Long clientInvoiceId)
    {
        return ytCustomerInvoiceMapper.deleteYtCustomerInvoiceById(clientInvoiceId);
    }
}
